package com.kgc.controller;

import com.kgc.pojo.Product;
import com.kgc.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/product")
public class ProductController {
    @Autowired
    private ProductService productService;
    @RequestMapping("/list")
    @ResponseBody
    public List<Product> selectProductList(){
        return productService.selectProductList();
    }
    @RequestMapping("/shownum")
    @ResponseBody
    public Product selectProductById(Integer productId){
        return productService.selectProductById(productId);
    }
}
